﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Copad.BusinessCard.BLL;

public partial class CategoryPermissions : BusinessCardPageBase
{
    GroupBLL groupBLL = new GroupBLL();
    UserBLL userBLL = new UserBLL();

    protected string AllGroups = "";
    protected string AllUsers = "";

    protected void Page_Load(object sender, EventArgs e)
    {
        var groups = groupBLL.Get(w => w.Name != Manager.SYSTEM_NAME);
        groups.ForEach(x =>
        {
            AllGroups += x.Name + ":" + x.ID + ",";
        });
        if (AllGroups != "")
        {
            AllGroups = AllGroups.Remove(AllGroups.Length - 1);
        }
        var users = userBLL.Get();
        users.ForEach(x =>
        {
            if (!userBLL.IsSystemUser(x.ID))
            {
                AllUsers += x.Username + ":" + x.ID + ",";
            }
        });
        if (AllUsers != "")
        {
            AllUsers = AllUsers.Remove(AllUsers.Length - 1);
        }
    }
}